<?php
namespace app\admin\model;

use app\common\model\System as SM;

class System extends SM
{
    /**
     * [lists 获取所有的配置项目]
     * @return [type] [description]
     */
    public static function lists()
    {
        return static::cache(180)->column('conf_value', 'conf_item');
    }

    /**
     * [updateItem 更新系统配置项目]
     * @param  [string] $item      [配置项目]
     * @param  [stirng] $value     [配置项目值]
     * @param  [integer] $conf_type [类型]
     * @return [bool|mixed]
     */
    public static function updateItem($item, $value, $conf_type)
    {
        return static::where('conf_item', $item)
            ->where('conf_type', $conf_type)
            ->update(['conf_value' => $value]);
    }
}
